package pl.PawelAndAlicja.badugiproject.main.Game;

//import game.Bet;
//import game.Biding;

import java.util.ArrayList;

public class Round {

	public static void main(String[] args) {

		ArrayList pool = new ArrayList();
		Bet bet = new Bet();
		Bidding bid = new Bidding();
		
		int myPool=1000;
		int myBet=50;
		
		bet.addSmallBigBet(pool);
		System.out.println("MyPool : " + myPool);
		System.out.println("Contents of pool : " + pool);
		
		Object myPoolBet;
		myPoolBet = pool.get(pool.size()-1);
		int intMyPoolBet = (Integer) myPoolBet;
		
		int action = 1;  // choose action (fold, allin, check etc...)
		
		if(pool.size() <= 1)
		{
			if(myPool < intMyPoolBet)
			{
				switch(action) {
					case 1: {myPool = bid.fold();}
					case 2: {myPool = bid.allIn(myPool, pool);}
				}
				
			}
			else{
			switch(action) {
				case 1: {myPool = bid.firstBet(myPool, myBet, pool); break;}
				case 2: {bid.check(); break;}
				case 3: {myPool = bid.rise(myPool, myBet, pool); break;}
				case 4: {myPool=bid.fold(); break;}
				case 5: {myPool = bid.call(myPool, pool); break;}
				case 6: {myPool = bid.allIn(myPool, pool); break;}
				}
			}
			
		}
		else if(pool.size()>1)
		{
		 	if(myPool < intMyPoolBet)
			{
				switch(action) {
					case 1: {myPool=bid.fold();}
					case 2: {myPool=bid.allIn(myPool, pool);}
				}
				
			}
		 	else {
		 		switch(action) {
				case 1: {bid.check(); break;}
				case 2: {myPool = bid.rise(myPool, myBet, pool); break;}
				case 3: {myPool=bid.fold(); break;}
				case 4: {myPool = bid.call(myPool, pool); break;}
				case 5: {myPool = bid.allIn(myPool, pool); break;}
		 		}
			}
		}
		System.out.println("MyPool : " + myPool);
		System.out.println("Contents of pool : " + pool);
	}
	
}
